package com.skillworld.webapp.model.team;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="teamranking")
public class TeamRanking {

    private Long teamRankingId;
    private Date date;
    private Team teamId1;
    private Team teamId2;
    private Team teamId3;
    private Team teamId4;
    private Team teamId5;
    
    public TeamRanking(){
        
    }
    
    public TeamRanking(Date date, Team teamId1,
            Team teamId2, Team teamId3, Team teamId4, Team teamId5) {
        
        this.date = date;
        this.teamId1 = teamId1;
        this.teamId2 = teamId2;
        this.teamId3 = teamId3;
        this.teamId4 = teamId4;
        this.teamId5 = teamId5;
    }

    @SequenceGenerator(name="TeamRankingIdGenerator",sequenceName="TeamRankingSeq")
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO,generator="TeamRankingIdGenerator")
    @Column(name="idRankingT")
    public Long getTeamRankingId() {
        return teamRankingId;
    }

    public void setTeamRankingId(Long teamRankingId) {
        this.teamRankingId = teamRankingId;
    }

    @Column(name = "date")
    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTeam1")
    public Team getTeamId1() {
        return teamId1;
    }

    public void setTeamId1(Team teamId1) {
        this.teamId1 = teamId1;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTeam2")
    public Team getTeamId2() {
        return teamId2;
    }

    public void setTeamId2(Team teamId2) {
        this.teamId2 = teamId2;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTeam3")
    public Team getTeamId3() {
        return teamId3;
    }

    public void setTeamId3(Team teamId3) {
        this.teamId3 = teamId3;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTeam4")
    public Team getTeamId4() {
        return teamId4;
    }

    public void setTeamId4(Team teamId4) {
        this.teamId4 = teamId4;
    }

    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="idTeam5")
    public Team getTeamId5() {
        return teamId5;
    }

    public void setTeamId5(Team teamId5) {
        this.teamId5 = teamId5;
    }
    
}
